package com.yetm.mapper;

import com.yetm.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    List<User> selectAll();
    User selectUser(int id);
    User selectUser(@Param("id") int id, @Param("address") String address); //多个参数需要加@Param
    void addUser(User user);
    void updateUser(User user);
    void deleteUserById(int id);

    //使用注解的方式，不需要配xml
    @Select("select * from user where id = #{id}")
    User selectUserByAnnotation(int id);
}
